package com.ksyun.seckill.constants;


/**
 * 活动状态.
 * @author ksc
 */
public enum CampaignStatus {

    INIT(1, "未上线","未上线"),
    ONLINE(2, "已上线","已上线"),
    FINISH(3, "已结束","已结束"),
    OFFLINE(4, "已下线","未上线"),

    DELETED(5, "已删除","未上线");

    public final Integer status;

    public final String descr;
    public final String consoleDescr;

    CampaignStatus(Integer status, String descr,String consoleDescr) {
        this.status = status;
        this.descr = descr;
        this.consoleDescr = consoleDescr;
    }

    public static CampaignStatus of(final Integer status) {
        CampaignStatus[] statuses = values();
        for (CampaignStatus campaignStatus : statuses) {
            if (campaignStatus.status.equals(status)) {
                return campaignStatus;
            }
        }
        throw new IllegalArgumentException("不合法的CampaignStatus:" + status);
    }

}

